<?php

/**
 * 后台首页
 * @author  xiaobai
 * @date    2017-01-08
 */

namespace app\panel\controller;

use app\common\controller\Panelbase;

class Index extends Panelbase
{

    public function index()
    {
        $mysql = Db()->query("select VERSION() as version");
        $mysql = $mysql[0]['version'];
        $mysql = empty($mysql) ? '未知' : $mysql;

        //server infomaions
        $info = array(
            '操作系统'     => PHP_OS,
            '运行环境'     => $_SERVER["SERVER_SOFTWARE"],
            'PHP版本'      => PHP_VERSION,
            'PHP运行方式'  => php_sapi_name(),
            'PHP版本'      => phpversion(),
            'MYSQL版本'    => $mysql,
            '上传附件限制'  => ini_get('upload_max_filesize'),
            '执行时间限制'  => ini_get('max_execution_time') . "s",
            '剩余空间'      => round((@disk_free_space(".") / (1024 * 1024)), 2) . 'M',
        );
        $this->assign('server_info', $info);

        return $this->fetch();
    }

}
